<!--  -->
<template>
  <div class="home">
    <Header />
    <Convid19info :convid19info="covid19InfoNews"></Convid19info>
    <CoivNum :caseNumData="caseNumData"/>
    <Map />
    <Myswiper/>
    <City/>
  </div>
</template>

<script>
import Header from "../components/Header";
import api from "../api/index.js";
import Convid19info from "../components/Convid19Info/Convid19info.vue";
import CoivNum from '../components/CovidNum'
import Map from '../components/Map/index.vue'
//import Map from '../components/Map/map1.vue'
import Myswiper from '../components/MySwiper'
import City from './City.vue'
export default {
  name: "",
  data() {
    return {
      covid19InfoNews: [],
      caseNumData:{
        modifyTime:"",                  //时间戳
        currentConfirmedCount:"",       //现存确诊人数
        confirmedCount:"",              //累计确诊人数
        suspectedCount:"",              //累计境外输入人数
        curedCount:"",                  //累计治愈人数
        deadCount:"",                   //累计死亡人数
        seriousCount:"",                //现存无症状人数
        currentConfirmedIncr:"",        //新增境外输入人数
        confirmedIncr:"",               //	相比昨天现存确诊人数
        curedIncr:"",                   //	相比昨天累计确诊人数
        deadIncr:"",                    //	相比昨天新增治愈人数
        seriousIncr:"",                 //	相比昨天新增死亡人数
        yesterdayConfirmedCountIncr:"", //	相比昨天现存无症状人数
      }
    };
  },
  components: {
    Header,
    Convid19info,
    CoivNum,
    Map,
    Myswiper,
    City
  },
  mounted() {
    api.api.getNcov({
        key: "62e34ad34025d5d5127135efa58d4ca8",
      })
      .then((res) => {
        if(res.status === 200)
        console.log(res);
        //疫情新闻信息
          this.covid19InfoNews = res.data.newslist[0].news
        //疫情病例数
          this.caseNumData.currentConfirmedCount = res.data.newslist[0].desc.currentConfirmedCount;
          this.caseNumData.confirmedCount = res.data.newslist[0].desc.confirmedCount;
          this.caseNumData.suspectedCount = res.data.newslist[0].desc.suspectedCount;
          this.caseNumData.curedCount     = res.data.newslist[0].desc.curedCount;
          this.caseNumData.deadCount      = res.data.newslist[0].desc.deadCount;
          this.caseNumData.seriousCount   = res.data.newslist[0].desc.seriousCount;
        //新增加的
          this.caseNumData.currentConfirmedIncr = res.data.newslist[0].desc.currentConfirmedIncr;
          this.caseNumData.confirmedIncr        = res.data.newslist[0].desc.confirmedIncr;
          this.caseNumData.curedIncr            = res.data.newslist[0].desc.curedIncr;
          this.caseNumData.deadIncr             = res.data.newslist[0].desc.deadIncr;
          this.caseNumData.seriousIncr          = res.data.newslist[0].desc.seriousIncr;
          this.caseNumData.yesterdaySuspectedCountIncr = res.data.newslist[0].desc.yesterdaySuspectedCountIncr;
        //接口返回时间
        this.caseNumData.modifyTime = res.data.newslist[0].desc.modifyTime
      })
      .catch((error) => {});
  },
};
</script>

<style  scoped>
#chinamap{
  width: 100%;
  height: 350px;
}
</style>
